#include<iostream>
#include<cmath>
using namespace std;


int main(){
	int N;
	char c;
	cin>>N>>c;
	int n=1;
	while(1){
		if(N>=2*n*n-1&&N<2*(n+1)*(n+1)-1)
			break;
		else{
			n++;
		}
	}

	for(int i=0;i<n;i++){
		for(int j=0;j<i;j++){
			cout<<" ";
		}
		for(int j=0;j<2*(n-i-1)+1;j++)
		{
			cout<<c;
		}
		for(int j=0;j<i;j++){
			cout<<" ";
		}
		cout<<endl;
	}
	for(int i=n-2;i>=0;i--){
		for(int j=0;j<i;j++){
			cout<<" ";
		}
		for(int j=0;j<2*(n-i-1)+1;j++)
		{
			cout<<c;
		}
		for(int j=0;j<i;j++){
			cout<<" ";
		}
		cout<<endl;
	}

	cout<<N-2*n*n+1<<endl;
}